#pragma once

#include <iostream>
#include <assert.h>
using namespace std;

struct Date
{
public:
	Date(int year = 2024, int month = 7, int day = 19);
	~Date();
	Date(const Date& d);
	Date& operator=(const Date& d);
	void Print();

	int GetMonthDay(int year, int month)
	{
		assert(month < 13 && month > 0);
		static int day[13] = { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		if ((month == 2) && ((year % 100 != 0 && year % 4 == 0) || (year % 400 == 0)))
		{
			return 29;
		}
		else
		{
			return day[month];
		}
	}

	Date& operator+=(int day);
	Date operator+(int day) const;
	Date& operator-=(int day);
	Date operator-(int day) const;
	Date& operator++();
	Date operator++(int);
	Date& operator--();
	Date operator--(int);

	bool operator==(const Date& d) const;
	bool operator!=(const Date& d) const;
	bool operator<(const Date& d) const;
	bool operator<=(const Date& d) const;
	bool operator>(const Date& d) const;
	bool operator>=(const Date& d) const;

private:
	int _year = 1;
	int _month = 1;
	int _day = 1;
};